﻿namespace CXW.Core.Sharp
{
    /// <summary></summary>
    public abstract class AbstractMenuCommandExt : AbstractMenuCommand
    {
        /// <summary>执行的<see cref="IViewContent"/>对象</summary>
        public abstract IViewContent ViewContent { get; }

        /// <remark/>
        public override void Run()
        {
            if (ViewContent == null)
                return;
            AbstractViewContent vc = ViewContent as AbstractViewContent;
            {
                vc.InfoTip = InfoTip;
                vc.Language = Language;
                vc.Label = Label;
                vc.CodonId = CodonId;
                vc.CfgName = CfgName;
                vc.Args = Args;
            }

            WorkbenchSingleton.Workbench.ShowView(ViewContent);
        }
    }
}
